﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Infragistics.WebUI.UltraWebListbar;

public partial class index_cwgl :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Customer.Competences.IsOwnedCompetences(Competences.BuildCompetencesList(Competences.Administrator)) || _Customer.CustomerTypeID == 0)
        {
            SiteParentItem();   //总商城菜单
        }
        else
        {
            SiteChildItem();    //子商城菜单，已激活会员的菜单
        }
    }

    #region Web 窗体设计器生成的代码

    protected override void OnLoad(EventArgs e)
    {
        isRequestLogin = true;                                  //是否需要登录
        RequestLoginPage = this.Request.Url.AbsoluteUri;        //获取决对Url
        isAtFramePageLogin = true;                              //是框架页

        //RequestCompetences = Competences.BuildCompetencesList(Competences.Finance); //页面权限

        base.OnLoad(e);
    }

    #endregion

    private void SiteParentItem()
    {
        lbModelName.Text = "财务管理"; //模块名称

        lbMain.Groups.Clear();

        Group group_szmx = new Group("收支明细", "g_szmx");
        setGroupStyle(group_szmx);
        lbMain.Groups.Add(group_szmx);
        Items items_szmx = lbMain.Groups.FromKey("g_szmx").Items;
        items_szmx.Clear();

        items_szmx.Add(new Item("收入明细", "./images/clearing/9_dian.jpg", "FinanceCenter/EarningList.aspx"));
        items_szmx.Add(new Item("支出明细", "./images/clearing/9_dian.jpg", "FinanceCenter/FundList.aspx"));

        Group group_rkjl = new Group("入款记录", "g_rkjl");
        setGroupStyle(group_rkjl);
        lbMain.Groups.Add(group_rkjl);
        Items items_rkjl = lbMain.Groups.FromKey("g_rkjl").Items;
        items_rkjl.Clear();

        items_rkjl.Add(new Item("入款记录", "./images/clearing/9_dian.jpg", "FinanceCenter/GatheringList.aspx"));

        Group group_cz = new Group("充值", "g_cz");
        setGroupStyle(group_cz);
        lbMain.Groups.Add(group_cz);
        Items items_cz = lbMain.Groups.FromKey("g_cz").Items;
        items_cz.Clear();

        items_cz.Add(new Item("手工充值", "./images/clearing/9_dian.jpg", "FinanceCenter/AddMoney.aspx"));
        //items_cz.Add(new Item("充值记录", "./images/clearing/9_dian.jpg", "page/AddMoneyDetails.aspx"));

        Group group_gzjs = new Group("工资结算", "g_gzjs");
        setGroupStyle(group_gzjs);
        lbMain.Groups.Add(group_gzjs);
        Items items_gzjs = lbMain.Groups.FromKey("g_gzjs").Items;
        items_gzjs.Clear();

        items_gzjs.Add(new Item("销售额统计", "./images/clearing/9_dian.jpg", "FinanceCenter/PVList.aspx"));
        items_gzjs.Add(new Item("月结网店零售奖", "./images/clearing/9_dian.jpg", "FinanceCenter/Earning3.aspx"));
        items_gzjs.Add(new Item("月结市场提成奖", "./images/clearing/9_dian.jpg", "FinanceCenter/Earning4.aspx"));
        items_gzjs.Add(new Item("月结管理补贴奖", "./images/clearing/9_dian.jpg", "FinanceCenter/Earning5.aspx"));
        items_gzjs.Add(new Item("月结销售分红奖", "./images/clearing/9_dian.jpg", "FinanceCenter/Earning6.aspx"));
        items_gzjs.Add(new Item("月结销售鼓励奖", "./images/clearing/9_dian.jpg", "FinanceCenter/Earning7.aspx"));

        items_gzjs.Add(new Item("周薪发放", "./images/clearing/9_dian.jpg", "FinanceCenter/AdminDistillMoney2.aspx"));
        items_gzjs.Add(new Item("月薪发送", "./images/clearing/9_dian.jpg", "FinanceCenter/AdminDistillMoney.aspx"));          

        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void SiteChildItem()
    {
        lbModelName.Text = "商务中心"; //模块名称

        lbMain.Groups.Clear();

        Group group_zxzx = new Group("在线咨询", "g_zxzx");
        setGroupStyle(group_zxzx);
        lbMain.Groups.Add(group_zxzx);
        Items items_zxzx = lbMain.Groups.FromKey("g_zxzx").Items;
        items_zxzx.Clear();

        items_zxzx.Add(new Item("在线资询", "./images/clearing/9_dian.jpg", "BalanceCenter/MyMessageBoardList.aspx"));


        Group group_yjtj = new Group("业绩统计", "g_yjtj");
        setGroupStyle(group_yjtj);
        lbMain.Groups.Add(group_yjtj);
        Items items_yjtj = lbMain.Groups.FromKey("g_yjtj").Items;
        items_yjtj.Clear();

        items_yjtj.Add(new Item("销售明细表", "./images/clearing/9_dian.jpg", "BalanceCenter/Net2.aspx"));
        items_yjtj.Add(new Item("奖金汇总表", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning.aspx"));
        items_yjtj.Add(new Item("奖金明细表", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning2.aspx"));


        Group group_hktz = new Group("汇款通知", "g_hktz");
        setGroupStyle(group_hktz);
        lbMain.Groups.Add(group_hktz);
        Items items_hktz = lbMain.Groups.FromKey("g_hktz").Items;
        items_hktz.Clear();

        items_hktz.Add(new Item("银行汇款通知", "./images/clearing/9_dian.jpg", "BalanceCenter/MyMessageBoardListCopy.aspx"));
        items_hktz.Add(new Item("支付宝在线充值", "./images/clearing/9_dian.jpg", "OnlinePay/Alipay02/Default.aspx"));


        Group group_khzl = new Group("客户资料", "g_khzl");
        setGroupStyle(group_khzl);
        lbMain.Groups.Add(group_khzl);
        Items items_khzl = lbMain.Groups.FromKey("g_khzl").Items;
        items_khzl.Clear();

        //items_khzl.Add(new Item("商城列表", "./images/clearing/9_dian.jpg", "shop/Shop_List.aspx"));
        //items_khzl.Add(new Item("商城网店管理", "./images/clearing/9_dian.jpg", "shop/ShopSiteConfig_BaseInfo.aspx"));
        //items_khzl.Add(new Item("商城会员", "./images/clearing/9_dian.jpg", "shop/Member_Manager.aspx"));        
        items_khzl.Add(new Item("注册会员购物明细表", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Query")); 


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }    

    private void setGroupStyle(Group group)
    {
        group.Expanded = false;
        group.TextAlign = "left";
        group.ItemAlign = "left";
        group.ImageTextAlign = ImageTextAlign.Middle;
    }    
     
}
